﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using control.Biz;

namespace control.Dal
{
    class DalPhanQuyen
    {
        internal static List<control.Biz.BizPhanQuyen> GetAll()
        {
            var qs = from q in DalCommon.TrangSucDB.PhanQuyens
                     select new BizPhanQuyen()
                     {
                         ID = q.ID,
                         Quyen = q.Quyen
                     };
            return qs.ToList<BizPhanQuyen>();
        }

        internal static BizPhanQuyen GetByID(int p)
        {
            var qs = from q in DalCommon.TrangSucDB.PhanQuyens
                     where q.ID==p
                     select new BizPhanQuyen()
                     {
                         ID = q.ID,
                         Quyen = q.Quyen
                     };
            return qs.FirstOrDefault<BizPhanQuyen>();
        }
    }
}
